home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / INTDOS.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  518 b   |  25 lines

  1. /* INTDOS.C --- p. 631 */
  2. #ifdef EXAMPLE_1
  3. #include <stdio.h>
  4. #include <dos.h>
  5. #define DOS_GETDRIVE 0x19
  6. union REGS xr;
  7. main()
  8. {
  9.     xr.h.ah = DOS_GETDRIVE;
  10.     intdos(&xr,&xr);
  11.         /* Adding 65 to the value gives us the drive letter */
  12.     printf("Current drive: %c\n", xr.h.al+65);
  13. }
  14. #endif
  15. #include <stdio.h>
  16. #include <dos.h>
  17. #define DOS_GETTIME 0x2c
  18. main()
  19. {
  20.     union REGS xr, yr;
  21.     xr.h.ah = DOS_GETTIME;
  22.     intdos(&xr, &yr);
  23.     printf("Current time is %.2d:%.2d:%.2d\n",
  24.                     yr.h.ch, yr.h.cl, yr.h.dh);
  25. }